<lv-treetable
  [lvData]="data"
  #lvTreeTable
  lvVirtualScroll
  [lvScroll]="{ y: '400px' }"
  lvVirtualMinBuffer="96px"
  [lvVirtualTrackBy]="trackByIndex"
  (lvStateChange)="stateChange($event)"
>
  <thead>
  <tr>
    <th lvCellKey="name">Name</th>
    <th lvCellKey="age">Age</th>
    <th lvCellKey="random">Random</th>
  </tr>
  </thead>
  <tbody>
  <ng-template lv-virtual-scroll let-item>
    <ng-container *ngTemplateOutlet="contentTpl; context: { $implicit: item }"></ng-container>
  </ng-template>
  <ng-template #contentTpl let-item>
    <tr>
      <td
        [lvShowExpanded]="item.children?.length"
        [(lvExpanded)]="item.expanded"
        [lvPaddingLeft]="item._lv_level * 24 + 'px'"
        (lvExpandedChange)="expandedChange($event)"
      >
        {{ item.data.name }}
      </td>
      <td>{{ item.data.age }}</td>
      <td>{{ item.data.random }}</td>
    </tr>
  </ng-template>
  </tbody>
</lv-treetable>
